<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TickTock - 浮动式侧边抽屉布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
        }
        
        body {
            background-color: #fafafa;
            color: #333;
            height: 100vh;
            overflow: hidden;
        }
        
        .app-container {
            display: flex;
            height: 100vh;
            position: relative;
            overflow: hidden;
            background-color: #fafafa;
        }
        
        /* 抽屉部分 */
        .drawer {
            width: 300px;
            height: calc(100% - 40px);
            background: linear-gradient(135deg, #3a47d5 0%, #00d2ff 100%);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            transform: translateX(-320px);
            transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
            position: absolute;
            z-index: 10;
            overflow-y: auto;
            border-radius: 0 24px 24px 0;
            top: 20px;
            left: 0;
            padding-bottom: 80px;
            color: white;
        }
        
        .drawer.open {
            transform: translateX(0);
        }
        
        .drawer-header {
            padding: 28px 24px;
            font-size: 22px;
            font-weight: 600;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .drawer-content {
            padding: 0 12px;
        }
        
        .list-section {
            margin-bottom: 24px;
        }
        
        .section-title {
            padding: 0 12px 12px 12px;
            font-size: 14px;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .list-item {
            padding: 14px 12px;
            margin-bottom: 4px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: background-color 0.2s ease;
            position: relative;
            overflow: hidden;
        }
        
        .list-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .list-item.active {
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        .list-item.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background-color: #fff;
            border-radius: 0 2px 2px 0;
        }
        
        .list-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .list-icon {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 16px;
        }
        
        .list-name {
            font-size: 16px;
            font-weight: 500;
        }
        
        .list-count {
            font-size: 12px;
            background-color: rgba(255, 255, 255, 0.3);
            padding: 2px 10px;
            border-radius: 16px;
        }
        
        .group-container {
            margin-left: 20px;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }
        
        .list-item.expanded + .group-container {
            max-height: 500px;
        }
        
        .group-item {
            padding: 12px 12px 12px 24px;
            margin-bottom: 4px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: background-color 0.2s ease;
            position: relative;
        }
        
        .group-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .group-item.active {
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        .group-item.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background-color: #fff;
            border-radius: 0 2px 2px 0;
        }
        
        .add-list-btn {
            position: absolute;
            bottom: 20px;
            left: 20px;
            right: 20px;
            padding: 14px;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }
        
        .add-list-btn:hover {
            background-color: rgba(255, 255, 255, 0.3);
        }
        
        /* 主内容区 */
        .main-content {
            flex: 1;
            padding: 20px;
            margin-left: 0;
            transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), border-radius 0.4s ease;
            height: 100%;
            overflow-y: auto;
            position: relative;
            background-color: #fafafa;
        }
        
        .main-content.drawer-open {
            transform: translateX(280px) scale(0.95);
            border-radius: 24px;
            box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            height: calc(100% - 40px);
            margin: 20px;
        }
        
        .main-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
        }
        
        .menu-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
        }
        
        .menu-btn:hover {
            background-color: #f0f0f0;
        }
        
        .menu-btn span {
            display: block;
            width: 18px;
            height: 2px;
            background-color: #333;
            position: relative;
            transition: all 0.3s ease;
        }
        
        .menu-btn span::before, 
        .menu-btn span::after {
            content: "";
            position: absolute;
            width: 18px;
            height: 2px;
            background-color: #333;
            transition: all 0.3s ease;
        }
        
        .menu-btn span::before {
            top: -6px;
        }
        
        .menu-btn span::after {
            top: 6px;
        }
        
        .menu-btn.active span {
            background-color: transparent;
        }
        
        .menu-btn.active span::before {
            transform: rotate(45deg);
            top: 0;
        }
        
        .menu-btn.active span::after {
            transform: rotate(-45deg);
            top: 0;
        }
        
        .page-title {
            font-size: 24px;
            font-weight: 600;
        }
        
        .page-actions {
            display: flex;
            gap: 16px;
        }
        
        .action-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            transition: all 0.2s ease;
        }
        
        .action-btn:hover {
            background-color: #f0f0f0;
        }
        
        .info-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 16px;
            padding: 20px;
            color: white;
            margin-bottom: 24px;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
        }
        
        .info-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .info-subtitle {
            opacity: 0.8;
            font-size: 14px;
        }
        
        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 24px 0 16px 0;
        }
        
        .section-title {
            font-size: 18px;
            font-weight: 600;
            color: #333;
        }
        
        .section-badge {
            font-size: 14px;
            padding: 4px 12px;
            background-color: #f0f0f0;
            border-radius: 12px;
            color: #666;
        }
        
        .task-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .task-card {
            background-color: #fff;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
            gap: 12px;
            transition: all 0.2s ease;
            cursor: pointer;
        }
        
        .task-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        }
        
        .task-header {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        
        .task-checkbox {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 2px solid #ddd;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .task-checkbox:hover {
            border-color: #3a47d5;
        }
        
        .task-checkbox.checked {
            background-color: #3a47d5;
            border-color: #3a47d5;
        }
        
        .task-checkbox.checked::after {
            content: "✓";
            color: white;
            font-size: 12px;
        }
        
        .task-title {
            font-size: 16px;
            font-weight: 500;
            flex: 1;
        }
        
        .task-details {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-left: 36px;
        }
        
        .task-tag {
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .priority-high {
            background-color: rgba(244, 67, 54, 0.1);
            color: #f44336;
        }
        
        .priority-medium {
            background-color: rgba(255, 152, 0, 0.1);
            color: #ff9800;
        }
        
        .priority-low {
            background-color: rgba(76, 175, 80, 0.1);
            color: #4caf50;
        }
        
        .task-date {
            background-color: rgba(0, 0, 0, 0.05);
            color: #666;
        }
        
        .bottom-bar {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            height: 70px;
            background-color: #fff;
            display: flex;
            align-items: center;
            justify-content: space-around;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
            z-index: 5;
            border-radius: 20px;
            width: 360px;
            max-width: 90%;
            padding: 0 10px;
        }
        
        .tab {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #999;
            font-size: 12px;
            gap: 4px;
            cursor: pointer;
            padding: 0 15px;
            transition: all 0.2s ease;
        }
        
        .tab.active {
            color: #3a47d5;
        }
        
        .tab-icon {
            font-size: 22px;
            transition: all 0.2s ease;
        }
        
        .tab:hover .tab-icon {
            transform: translateY(-2px);
        }
        
        .add-btn {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #3a47d5 0%, #00d2ff 100%);
            border-radius: 16px;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            box-shadow: 0 5px 15px rgba(58, 71, 213, 0.3);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .add-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(58, 71, 213, 0.4);
        }
        
        /* 半透明遮罩 */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            z-index: 5;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        
        .overlay.active {
            opacity: 1;
            pointer-events: auto;
        }
        
        /* 完成任务样式 */
        .task-checkbox.checked + .task-title {
            text-decoration: line-through;
            color: #999;
        }
        
        @media (max-width: 768px) {
            .drawer {
                width: 280px;
                transform: translateX(-300px);
            }
            
            .main-content.drawer-open {
                transform: translateX(260px) scale(0.9);
            }
            
            .bottom-bar {
                width: 320px;
            }
        }
    </style>
</head>
<body>
    <div class="app-container">
        <!-- 抽屉菜单 -->
        <div class="drawer" id="drawer">
            <div class="drawer-header">
                <span style="font-size: 24px;">⏱️</span>
                <span>TickTock</span>
            </div>
            
            <div class="drawer-content">
                <div class="list-section">
                    <div class="section-title">主要清单</div>
                    
                    <div class="list-item">
                        <div class="list-title">
                            <div class="list-icon">📊</div>
                            <div class="list-name">工作清单</div>
                        </div>
                        <div class="list-count">5/12</div>
                    </div>
                    
                    <div class="list-item">
                        <div class="list-title">
                            <div class="list-icon">📚</div>
                            <div class="list-name">学习清单</div>
                        </div>
                        <div class="list-count">2/8</div>
                    </div>
                </div>
                
                <div class="list-section">
                    <div class="section-title">个人清单</div>
                    
                    <div class="list-item expanded">
                        <div class="list-title">
                            <div class="list-icon">🏠</div>
                            <div class="list-name">个人清单</div>
                        </div>
                        <div class="list-count">3/10</div>
                    </div>
                    
                    <div class="group-container">
                        <div class="group-item">
                            <div class="list-name">日常事务</div>
                            <div class="list-count">1/3</div>
                        </div>
                        
                        <div class="group-item active">
                            <div class="list-name">健康习惯</div>
                            <div class="list-count">2/4</div>
                        </div>
                        
                        <div class="group-item">
                            <div class="list-name">旅行计划</div>
                            <div class="list-count">0/3</div>
                        </div>
                    </div>
                    
                    <div class="list-item">
                        <div class="list-title">
                            <div class="list-icon">🛒</div>
                            <div class="list-name">购物清单</div>
                        </div>
                        <div class="list-count">1/5</div>
                    </div>
                </div>
            </div>
            
            <div class="add-list-btn">
                <span style="font-size: 20px;">+</span>
                <span>新建清单</span>
            </div>
        </div>
        
        <!-- 半透明遮罩 -->
        <div class="overlay" id="overlay"></div>
        
        <!-- 主内容区 -->
        <div class="main-content" id="main-content">
            <div class="main-header">
                <div class="menu-btn" id="menu-btn">
                    <span></span>
                </div>
                <div class="page-title">健康习惯</div>
                <div class="page-actions">
                    <div class="action-btn">🔍</div>
                    <div class="action-btn">⋮</div>
                </div>
            </div>
            
            <div class="info-card">
                <div class="info-title">健康习惯 - 任务</div>
                <div class="info-subtitle">已完成: 2/4 任务 (50%)</div>
            </div>
            
            <div class="section-header">
                <div class="section-title">待办</div>
                <div class="section-badge">2 项</div>
            </div>
            
            <div class="task-list">
                <div class="task-card">
                    <div class="task-header">
                        <div class="task-checkbox"></div>
                        <div class="task-title">每日喝水2L</div>
                    </div>
                    <div class="task-details">
                        <div class="task-tag priority-high">⚡ 优先级高</div>
                        <div class="task-tag task-date">🕒 今天</div>
                    </div>
                </div>
                
                <div class="task-card">
                    <div class="task-header">
                        <div class="task-checkbox"></div>
                        <div class="task-title">冥想练习</div>
                    </div>
                    <div class="task-details">
                        <div class="task-tag priority-low">🟢 优先级低</div>
                        <div class="task-tag task-date">🕒 明天</div>
                    </div>
                </div>
            </div>
            
            <div class="section-header">
                <div class="section-title">已完成</div>
                <div class="section-badge">2 项</div>
            </div>
            
            <div class="task-list">
                <div class="task-card">
                    <div class="task-header">
                        <div class="task-checkbox checked"></div>
                        <div class="task-title">晨跑30分钟</div>
                    </div>
                    <div class="task-details">
                        <div class="task-tag priority-medium">🔶 优先级中</div>
                        <div class="task-tag task-date">🕒 今天</div>
                    </div>
                </div>
                
                <div class="task-card">
                    <div class="task-header">
                        <div class="task-checkbox checked"></div>
                        <div class="task-title">健康饮食</div>
                    </div>
                    <div class="task-details">
                        <div class="task-tag priority-medium">🔶 优先级中</div>
                        <div class="task-tag task-date">🕒 昨天</div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部导航栏 -->
        <div class="bottom-bar">
            <div class="tab active">
                <div class="tab-icon">📋</div>
                <div>清单</div>
            </div>
            <div class="tab">
                <div class="tab-icon">📅</div>
                <div>今日</div>
            </div>
            <div class="add-btn">+</div>
            <div class="tab">
                <div class="tab-icon">📊</div>
                <div>统计</div>
            </div>
            <div class="tab">
                <div class="tab-icon">👤</div>
                <div>我的</div>
            </div>
        </div>
    </div>
    
    <script>
        const menuBtn = document.getElementById('menu-btn');
        const drawer = document.getElementById('drawer');
        const mainContent = document.getElementById('main-content');
        const overlay = document.getElementById('overlay');
        
        menuBtn.addEventListener('click', () => {
            menuBtn.classList.toggle('active');
            drawer.classList.toggle('open');
            mainContent.classList.toggle('drawer-open');
            overlay.classList.toggle('active');
        });
        
        overlay.addEventListener('click', () => {
            menuBtn.classList.remove('active');
            drawer.classList.remove('open');
            mainContent.classList.remove('drawer-open');
            overlay.classList.remove('active');
        });
        
        // 抽屉内列表展开/折叠功能
        const listItems = document.querySelectorAll('.list-item');
        listItems.forEach(item => {
            if (!item.parentElement.classList.contains('group-container')) {
                item.addEventListener('click', () => {
                    if (item.nextElementSibling && item.nextElementSibling.classList.contains('group-container')) {
                        item.classList.toggle('expanded');
                    }
                });
            }
        });
    </script>
</body>
</html> 